package com.st.springts.demos.web;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor

public class Result<T> {
    private Integer code;   //状态码
    private String message; //返回信息

    private T data;         //返回数据


    public static <T> Result<T> success(String message, T data) {
        return new Result<>(ResultCode.SUCCESS, message, data);
    }

    public static <T> Result<T> error(int resultCode, String message) {
        return new Result<>(resultCode, message, null);
    }


}

